package com.platform.entity;

import java.io.Serializable;
import java.util.Date;

import com.platform.utils.DateUtils;

/**
 * 实体
 * 表名 nideshop_goods_read_permission
 *
 * @author LarkerJin
 * @email 277901879@qq.com
 * @date 2019-07-16 17:19:59
 */
public class GoodsReadPermissionEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    
    //
    private Integer id;
    //商品ID  -1 含所有read权限
    private Integer goodsId;
    //用户ID
    private Integer userId;
    //订单ID -- 赠送为赠送人ID
    private Integer orderId;
    //0:赠送，1:购买
    private Integer source;
    //是否有编辑权限-作者
    private Integer editPermissions;
    
    /**
     * 单文章、整栏目、或全文
     */
    private String objectType;
    //到期时间
    private Date expiredDate;
    //创建时间
    private Date createDate;

    /**
     * 设置：
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取：
     */
    public Integer getId() {
        return id;
    }
    /**
     * 设置：商品ID    0 含所有read权限
     */
    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 获取：商品ID
     */
    public Integer getGoodsId() {
        return goodsId;
    }
    /**
     * 设置：用户ID
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取：用户ID
     */
    public Integer getUserId() {
        return userId;
    }
    /**
     * 设置：订单ID
     */
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    /**
     * 获取：订单ID -- 赠送为赠送人ID
     */
    public Integer getOrderId() {
        return orderId;
    }
    /**
     * 设置：0:赠送，1:购买
     */
    public void setSource(Integer source) {
        this.source = source;
    }

    /**
     * 获取：0:赠送，1:购买
     */
    public Integer getSource() {
    	if(source == null)
    		source = 0;
        return source;
    }
    /**
     * 设置：到期时间
     */
    public void setExpiredDate(Date expiredDate) {
        this.expiredDate = expiredDate;
    }

    /**
     * 获取：到期时间
     */
    public Date getExpiredDate() {
    	if(expiredDate == null) {
    		expiredDate = DateUtils.FOREVER_DATE;
    	}
        return expiredDate;
    }
    /**
     * 设置：创建时间
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * 获取：创建时间
     */
    public Date getCreateDate() {
        return createDate;
    }

	public Integer getEditPermissions() {
		return editPermissions;
	}

	public void setEditPermissions(Integer editPermissions) {
		this.editPermissions = editPermissions;
	}

	public String getObjectType() {
		return objectType;
	}

	public void setObjectType(String objectType) {
		this.objectType = objectType;
	}
	
}
